<div style="position: absolute;top: 120px; left: 450px" class="navBox">
    <div class="comWidth">
        <ul class="nav">
            <li  class="active"><a href="javascript:void(0)"> 付款登记：</a><span></span></li>
            <li> <a href="javascript:void(0)" onclick="endPoMain('货到付款')" style="font-size: 15px ;font-weight: bold">货到付款</a></li>
            <li> <a href="javascript:void(0)"onclick="endPoMain('款到发货')" style="font-size: 15px ;font-weight: bold">款到发货</a></li>
            <li> <a href="javascript:void(0)"onclick="endPoMain('预付款发货')" style="font-size: 15px ; font-weight: bold">预付款付款</a></li>
        </ul>
    </div>
</div>

<br>
<table class="altrowstable">
    <tr>
        <td>编号</td>
        <td>采购单编号</td>
        <td>创建时间</td>
        <td>供应商名称</td>
        <td>创建用户</td>
        <td>附加费用</td>
        <td>采购产品总价</td>
        <td>采购单总价格</td>
        <td>付款方式</td>
        <td>处理状态</td>
        <td>明细</td>
        <td>操作</td>
    </tr>
    <tbody id="endPoMainBody">

    </tbody>
    <div  style="position: absolute; margin-top: 0px;padding-left: 700px">
        <ul id="page">分页</ul>
    </div>
</table>


<script type="text/html" id="endPoMainTemplate">
    {{each data}}
    <tr>
        <td>{{$index+1}}</td>
        <td>{{$value.poID}}</td>
        <td>{{$value.createTime}}</td>
        <td>{{$value.venderCode}}</td>
        <td>{{$value.account}}</td>
        <td>{{$value.tipFee}}</td>
        <td>{{$value.productTotal}}</td>
        <td>{{$value.poTotal}}</td>
        <td>{{$value.payType}}</td>
        <td>{{$value.status}}</td>
        <td><font style="color: #e8198b" onclick="{{'getPoItem(\''+ $value.poID +'\')'}}">查看明细</font></td>
        <td><span style="color: #b51204" onclick="{{'realEndPoMain(\''+$value.poID+'\')'}}">了结</span></td>
    </tr>
    {{/each}}
</script>
<script>
    $(function () {
        endPoMain('货到付款');
    })
    function endPoMain(payType) {
        showPage({
            currentPage:1,
            pageSize:3,
            url:'endPoMain',
            templateId: 'endPoMainTemplate',
            contentId: 'endPoMainBody',
            params:{
                payType:payType
            }
        })
    }

    function realEndPoMain(poID) {
        var flag=window.confirm("确认了结")
        if (flag){
            Ajax.post('realEndPoMain',{poID:poID},function (result) {
                alert(result.message);
                endPoMain('货到付款');
            })
        }
    }
</script>
